import router.Router;
import managers.LinksManager;
import managers.RoutersManager;


public class Main {
	public static void main(String[] args) {
		String test = "2";
		LinksManager linksManager = new LinksManager();
		linksManager.readFile();
		System.out.println(linksManager.toString());
		
		RoutersManager routersManager = new RoutersManager();
		routersManager.readFile();
		System.out.println(routersManager.toString());
		
		Router router = routersManager.getRouterById(test);
		router.setNeighbors(linksManager.getNeighbors(test));
		
//		RouteTable routerTable = new RouteTable(test, routersManager.getSize());
		
//		router.setTable(routerTable);
		
		//por ana gabrielle ... atualizando os vizinhos de todos
		System.out.println(router.toString());
		router.printNeighbors();
		Router router1 = routersManager.getRouterById(1+"");
		router1.setNeighbors(linksManager.getNeighbors(1+""));
		Router router2 = routersManager.getRouterById(2+"");
		router2.setNeighbors(linksManager.getNeighbors(2+""));
		Router router3 = routersManager.getRouterById(3+"");
		router3.setNeighbors(linksManager.getNeighbors(3+""));
		Router router4 = routersManager.getRouterById(4+"");
		router4.setNeighbors(linksManager.getNeighbors(4+""));
		Router router5 = routersManager.getRouterById(5+"");
		router5.setNeighbors(linksManager.getNeighbors(5+""));
		
		//setando os links no routersManager para que possa pegar os custos
		routersManager.setLinksManager(linksManager);
		
		System.out.println("--");
		//atualizando uma tabela, que atualizando todas as outras
		routersManager.updateTable(1+"");
		System.out.println(routersManager.toString());
		
	}
}
